export function thunk(store) {
  return function temp(dispatch) {
    return function new_dispatch(action) {
      if (typeof action == 'function') {
        return action(dispatch, store.getState)
      }
      dispatch(action)
    }
  }
}

export const logger = store => dispatch => action => {
  console.log('老值', JSON.parse(JSON.stringify(store.getState())))
  let res = dispatch(action)
  console.log("新值", JSON.parse(JSON.stringify(store.getState())))
  return res
}